<extend name="Public/base" />

<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>消耗品入库</h2>
    </div>
    <div class="row" ng-controller="SubproInCtrl" ng-init="init()">
            <form action="{:U('inadd')}" method='post' class="form-horizontal" >
            <div class="form-item">
                <div class="controls"></div>
            </div>
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-body" style="padding-bottom: 0px;padding-top: 0px;">
                        <div style="border: #000 1px solid;margin-top: 5px;margin-bottom: 5px;" class='data-table table-striped '>
                            <table  id="tbodyspec">
                                <thead>
                                <tr>
                                    <th scope="col" width="20%">商品名称</th>
                                    <th scope="col" width="10%">商品编码</th>
                                    <th>单位</th>
                                    <th style="padding-left: 50px;">数量</th>
                                    <th>总价</th>
                                </tr>
                                </thead>
                                <tbody id="tbodyspec_a">
                                    <tr>
                                        <td class="change">
                                            <select select2 style="height: 30px; width:180px;" ng-change="select(x)" ng-model="x">
                                                <option value="">请选择...</option>
                                                <option ng-repeat="p in product" value="{{($index)}}" >{{p.pname}}({{p.spec}})</option>
                                            </select>
                                        </td>
                                        <td>
                                            <input type="text" class="form-control input" name="BIN" ng-model="pro.BIN" readonly/>
                                        </td>
                                        <td>
                                            <input type="text" class="form-control input-small"  value="{{pro.mother_to_son}}{{pro.son_unit}}/{{pro.mother_unit}}" name="unit"  readonly/>
                                        </td>
                                        <td class="row" style="padding: 0">
                                            <div class="col-lg-3" style="padding: 0;margin: 0">
                                                <div class="input-group ">
                                                    <input type="number" style="" class="form-control input-x" ng-change="cnt()" ng-model="pro.mother_unit_cnt" name="mother_unit_cnt" />
                                                    <span class="input-group-addon" ng-bind="pro.mother_unit"></span>
                                                </div>
                                            </div>
                                            <span style="margin: 0" class="col-lg-1">或</span>
                                            <div class="col-lg-3" style="padding: 0;margin: 0">
                                                <div class="input-group " >
                                                    <input type="number" style="" class="form-control input-x" ng-change="cnt()" ng-model="pro.son_unit_cnt" name="son_unit_cnt" />
                                                    <span class="input-group-addon" ng-bind="pro.son_unit"></span>
                                                </div>
                                            </div>
                                            <input type="number" name="number" class="form-control input-small hide" ng-model="pro.number" />
                                        </td>
                                        <td>
                                            <input type="text" class="text input-small hide" name="mother_unit" value="{{pro.mother_unit}}" readonly/>
                                            <input type="text" class="text input-small hide" name="son_unit" value="{{pro.son_unit}}" readonly/>
                                            <input type="text" class="text input-small hide" name="mother_to_son" value="{{pro.mother_to_son}}" readonly/>
                                            <input type="text" class="text input-small hide" name="pname" value="{{pro.pname}}" readonly/>
                                            <input type="text" class="text input-small hide" name="spec" value="{{pro.spec}}" readonly/>
                                            <input type="totalprice" class="form-control input-small"  ng-model="pro.totalprice" name="totalprice" />
                                        </td>
                                    </tr>
                                <!--读取商品信息-->
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-12">
                <button class="btn confirm btn-danger ajax-post" id="submit" type="submit" target-form="form-horizontal" autocomplete="off">入 库</button>
                <a  class="btn btn-primary" id="fh" onclick="javascript:history.back(-1); return false;">返 回</a>
            </div>
            <br><br>
        </form>
        
        
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Subpro/inlist')}');
    </script>
</block>
